/*
 * 创建日期 2009-11-11
 *
 * 成都天和软件公司
 * 电话：028-85425861
 * 传真：028-85425861-8008
 * 邮编：610041 
 * 版权所有
 */
package  org.fantasy.cpp.core.item.date;

import  org.fantasy.cpp.core.item.AbstractItem;

/**
 *  日期输入框
 * @author: 王文成
 * @version: 1.0
 * @since 2009-11-11
 */
public abstract class AbstractDateItem extends AbstractItem {

	@Override
	public String getHtml() throws Exception {
		StringBuffer html = new StringBuffer(1024);
		String name = item.getItemName();
		String defValue = item.getDefValue();
		String format = item.getItemFormat();
		html.append("  <span> \n");
		html.append("  <input class='input_date' type='text' name='" + name + "' " + getStyleHtml() + getClassHtml()
				+ " readonly='true' value='" + defValue + "' /> \n");
		html.append("  <script type='text/javascript'> \n");
		html.append("  try{Calendar.setup({inputField:'" + name + "',ifFormat:'" + format + "',button:'" + name
				+ "'});}catch(e){} \n");
		html.append("  </script> \n");
		html.append("  </span> \n");
		return html.toString();
	}
}
